<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue 中css动画原理</title>
    <script src="../vue.js"></script>
    <style>
        .v-enter{
            opacity: 0
        }
        .v-enter-active{
            transition: opacity 3s;
        }
        .v-leave-to{
            opacity: 0;
        }
        .v-leave-active{
            transition: opacity 3s;
        }
    </style>
   
</head>
<body>
    <div id="app"> 
        <transition>
            <div v-if ="show">hello world </div>
        </transition>       
        <button @click="handleBtnClick">change</button>
    </div>   
    
    <script>    
       
    
        var root = new Vue({
            el: '#app',
            data: {
                show: true
            },            
            methods: {
                handleBtnClick: function(){
                    this.show = ! this.show
                }
            }        
           
        });
    </script>
</body>
</html>